StoredLearningSession.ExitCurrentActivity Method

Immediately exits the current activity without processing any pending navigation requests and without saving any data model values that have not been committed.

Parent Type: StoredLearningSession

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public override void ExitCurrentActivity ()

Exceptions
Exception type Condition
InvalidOperationException

Thrown if there is no current activity in the session.

SequencingException

Thrown if the state of the session, such as the current sequencing rules, do not allow processing the requested navigation.

Remarks

It is recommended the application call CommitChanges after exiting the current activity to ensure any pending data changes are saved.

If the caller wants to be able to resume the current activity at a future time, it should set NavigationRequest.ExitMode value of LearningDataModel.NavigationRequest to Suspend before calling this method.

This method will process the postConditionRules for the current activity. This may result in another activity becoming the current activity in the session. It may also result in not being able to identify a current activity for the session.